import React from 'react';
import { Select, Modal } from 'antd';
const { Option } = Select;

const modal = ({ visible, onOk, onCancel, defaultGroup, selectOnChange }) => {

    return (
        <Modal
            visible={visible}
            title="加入用户组"
            onOk={onOk}
            onCancel={onCancel}
            okText="加入"
            cancelText="关闭"
        >
            <Select
                showSearch
                defaultValue={defaultGroup}
                style={{ width: 200 }}
                placeholder="选择一个分组"
                optionFilterProp="children"
                onChange={selectOnChange}
                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
            >
                <Option value="0">普通用户</Option>
                <Option value="1">编辑</Option>
            </Select>
        </Modal>
    )
}

export default modal;
